package com.east.utils;

import java.util.List;

import org.apache.tomcat.jni.Global;


/**
 * 
 * @author lazite
 *
 */
public class Pagenation {
	private Integer pageNum;//第几页
	private Integer pageSize;//一叶几条
	private Integer pageCount;//总共多少页
	private Integer totalNums;//总共多少条
	private List data;
	
	//当前页码，每页大小，总页数对象集合值
	public Pagenation(Integer pageNum, Integer totalNums,Integer pageCount) {
		super();
		this.pageNum = pageNum;
		this.totalNums = totalNums;
		this.pageCount = pageCount;
	}
	
	//当前页码，每页大小，总页数，当前页码的对象集合值
	public Pagenation(Integer pageNum, Integer totalNums,Integer pageCount,List data) {
		super();
		this.pageNum = pageNum;
		this.totalNums = totalNums;
		this.pageCount = pageCount;
		this.data = data;
	}
	//当前页码，每页大小，总页数，当前页码的对象集合值
		public Pagenation(Integer pageSize,Integer pageNum, Integer totalNums,Integer pageCount,List data) {
			super();
			this.pageSize= pageSize;
			this.pageNum = pageNum;
			this.totalNums = totalNums;
			this.pageCount = pageCount;
			this.data = data;
		}

	
	public Pagenation() {
		
	}
	
	public  Pagenation(Integer pageNum, Integer size) {
		this.setPageNum(pageNum);
		this.setPageSize(size);
	}
	public Pagenation initControllerPagenation(Pagenation pagenation) {
		pagenation.setPageSize(10);
		pagenation.setPageNum(pagenation.getPageNum()!=null&&pagenation.getPageNum()>0?pagenation.getPageNum()-1:0);;//查第几页,对不传页码设置为第一页
		return pagenation;
	}
	

	public Integer getPageNum() {
		return pageNum;
	}

	public void setPageNum(Integer pageNum) {
		this.pageNum = pageNum;
	}

	public Integer getTotalNums() {
		return totalNums;
	}

	public void setTotalNums(Integer totalNums) {
		this.totalNums = totalNums;
	}

	public List getData() {
		return data;
	}

	public void setData(List data) {
		this.data = data;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer size) {
		this.pageSize = size;
	}


	public Integer getPageCount() {
		return pageCount;
	}

	public void setPageCount(Integer pageCount) {
		this.pageCount = pageCount;
	}

	@Override
	public String toString() {
		return "Pagenation [pageNum=" + pageNum + ", pageSize=" + pageSize + ", pageCount=" + pageCount + ", totalNums="
				+ totalNums + "]";
	}

	
}
